{% extends "default/base.html" %}
{% load humanize %}
{% load i18n %}

{% block meta_keywords %}marketplace blog keywords here{% endblock %}

{% block content %}
<ul class="breadcrumb">
 <li><a href="{% url market_home %}">{% trans "Home" %}</a><span class="divider"> / </span></li>
 <li><a href="{% url market_blog %}">{% trans "Blog" %}</a></li>
</ul>

<script type="text/javascript">

$(document).ready(function(){
	$("div[id^='comment_box']").hide();
});

function open_shops_dialog(box_id){
	var box = "comment_box_" + box_id;
	$("#" + box).slideToggle();
};

function close_shops_dialog(box_id){
	var box = "comment_box_" + box_id;
	$("#" + box).slideUp();
};

$(function() {
	$("#tree").treeview({
		collapsed: true,
		animated: "fast",
		persist: "location"
	});
})

</script>

{% block filter_content %}
<div class="sidebar">
 <div class="well">

	<!-- ARCHIVE SECTION -->
	<h5>{% trans "Blog Archive" %}</h5>
	{% regroup archive by month as post_list %}
	<ul id="tree">
	{% for post in post_list %}
		{% if forloop.count == 7 %}
    		{{ break }}
		{% endif %}
	    <li>{{ post.grouper }} ({{ post.list|length }})
	    <ul>
	        {% for item in post.list %}
	        	<li><a href="{% url market_blog_view_post item.slug %}">{{ item.title|slice:"25" }}...</a></li>	
			</br>
	        {% endfor %}
	    </ul>
	    </li>
	{% endfor %}
	</ul>

	<!-- EDITOR POST's PICKS -->
	<h5>{% trans "Editor Post's Picks" %}</h5>
	<ul class="post_summary">
	{% for pick in picks %}
		{% if forloop.count == 5 %}
    		{{ break }}
		{% endif %}
		<li><a href="{% url market_blog_view_post pick.post.slug %}">{{ pick.post.title }}</a></li>
		</br>
	{% endfor %}			
	</ul>

	<!-- LATEST POSTS SECTION -->
	<h5>{% trans "Lastest Post" %}</h5>
	<ul class="post_summary">
	{% for post in latest_posts %}
		{% if forloop.count == 5 %}
    		{{ break }}
		{% endif %}
		<li><a href="{% url market_blog_view_post post.slug %}">{{ post.title }}</a></li>
		</br>
	{% endfor %}			
	</ul>
	{% comment %}
	<!-- LATEST COMMENTS SECTION -->
	<h5>{% trans "Latest Comments" %}</h5>
	<ul class="comment_summary">
	{% for comment in latest_comments %}
    	<li>{{ comment.user }}says : {{ comment.comment.capitalize|truncatewords:5|striptags }}</li>
	</br>
	{% endfor %}
			
	</ul>
	{% endcomment %}	
</div>
</div>
{% endblock %}

<div class="span12">


{% for post in posts.object_list %}
	{% include "default/post_render.html" %}
{% endfor %}

<div class="pagination">
{% with posts as objects %}
	{% include 'advanced_paginator.html'%}
{% endwith %}
</div>
	
</div>

{% endblock %}

